/**
 * Copyright (c) 2009  Collaborative Development Group, C.S. Dept., University of Bari
 *
 * All rights reserved. This program and the accompanying materials are made available under
 * the terms of the Eclipse Public License v1.0  which accompanies this distribution, and is 
 * available at http://www.eclipse.org/legal/epl-v10.html
 */
package it.uniba.di.cdg.jtalk.ui.login;

import it.uniba.di.cdg.penelope.ui.AbstractPresentationModel;

/**
 * Implementation of {@link ILoginPresentationModel}. 
 */
public class LoginPresentationModel extends AbstractPresentationModel implements ILoginPresentationModel {
	private static final long serialVersionUID = -1892113425416722853L;

	private String userId = "";
	
	private String password = "";
	
	private Boolean rememberPassword = false;
	
	private Boolean automaticLogin = false;

	/**
	 * 
	 */
	public LoginPresentationModel() {
		super();
	}
	
	/* (non-Javadoc)
	 * @see it.uniba.di.cdg.jtalk.ui.login.ILoginModel#getUserId()
	 */
	public String getUserId() {
		return userId;
	}

	/* (non-Javadoc)
	 * @see it.uniba.di.cdg.jtalk.ui.login.ILoginModel#setUserId(java.lang.String)
	 */
	public void setUserId( String userId ) {
		firePropertyChange( USER_ID_PROPERTY, this.userId, this.userId = userId );
	}

	/* (non-Javadoc)
	 * @see it.uniba.di.cdg.jtalk.ui.login.ILoginModel#getPassword()
	 */
	public String getPassword() {
		return password;
	}

	/* (non-Javadoc)
	 * @see it.uniba.di.cdg.jtalk.ui.login.ILoginModel#setPassword(java.lang.String)
	 */
	public void setPassword( String password ) {
		firePropertyChange( PASSWORD_PROPERTY, this.password, this.password = password );
	}

	/* (non-Javadoc)
	 * @see it.uniba.di.cdg.jtalk.ui.login.ILoginModel#isRememberPassword()
	 */
	public Boolean isRememberPassword() {
		return rememberPassword;
	}

	/* (non-Javadoc)
	 * @see it.uniba.di.cdg.jtalk.ui.login.ILoginModel#setRememberPassword(Boolean)
	 */
	public void setRememberPassword( Boolean rememberPassword ) {
		firePropertyChange( REMEMBER_PASSWORD_PROPERTY, this.rememberPassword, this.rememberPassword = rememberPassword );
	}

	/* (non-Javadoc)
	 * @see it.uniba.di.cdg.jtalk.ui.login.ILoginModel#isAutomaticLogin()
	 */
	public Boolean isAutomaticLogin() {
		return automaticLogin;
	}

	/* (non-Javadoc)
	 * @see it.uniba.di.cdg.jtalk.ui.login.ILoginModel#setAutomaticLogin(Boolean)
	 */
	public void setAutomaticLogin( Boolean automaticLogin ) {
		firePropertyChange( AUTOMATIC_LOGIN_PROPERTY, this.automaticLogin, this.automaticLogin = automaticLogin );
	}
}
